﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class VerticalFill : MonoBehaviour
{
    RectTransform Rect;
    float oriHeight;

    // Start is called before the first frame update
    void Start()
    {
        Rect = GetComponent<RectTransform>();
        oriHeight = Rect.rect.height;
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void Filling(float percent)
    {
        Rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, oriHeight*percent);
    }
}
